<script setup>
import { } from 'vue'

const props = defineProps({
  song: {
    type: Object
  }
})

</script>

<template>
  <div class="list-card-box">
    <div class="list-card">
      <img v-lazy-image="props.song.picUrl || song.coverImgUrl + '?param=200y200'">
      <div class="info">
        <i class="iconfont icon-tingge"></i>
        <span v-format-play-count="props.song.playcount || props.song.playCount"></span>
      </div>
    </div>
    <p>{{ props.song.name }}</p>
  </div>
</template>

<style scoped lang='scss'>
.list-card-box {
  height: 210px;

  .list-card {
    position: relative;
    height: 180px;
    max-width: 180px;
    background-size: cover;
    border-radius: 5px;
    overflow: hidden;
    cursor: pointer;
      box-shadow: 0px 2px 4px #eaeaea;

    &:hover {
      box-shadow: 0px 6px 6px #c9c9c9;
      transition: 0.2s linear;
    }

    img {
      width: 100%;
      height: 100%;
      background-color: #eaeaea;
    }

    .info {
      font-weight: bold;
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      padding: 0px 10px;
      line-height: 30px;
      text-align: right;
      color: #fff;
      text-shadow: 0px 0px 3px #272727;

      .icon-tingge {
        margin-right: 2px;
        font-size: 18px;
      }
    }
  }

  p {
    width: 180px;
    margin-top: 10px;
    font-weight: bold;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
  }
}
</style>
